@extends('backend::layout')
@section('title',$page_title)
@section('content')
    @component('backend::component.form.form')
        @slot('page_title') {{$page_title}} @endslot
        @slot('formId') config-form @endslot
        @slot('action') {{isset($config_info)?route('b_Config_update',['name'=>$config_info->name]):route('b_Config_save')}} @endslot
        @component('backend::component.form.form-group')
            @slot('title')配置标识@endslot
            @component('backend::component.form.input')
                @slot('name') config_name @endslot
                @slot('value') {{$config_info->name ?? ''}} @endslot
                @slot('attr')
                    @if(isset($config_info->name))  disabled  @endif
                @endslot
            @endcomponent
        @endcomponent

        @component('backend::component.form.form-group')
            @slot('title')配置标题@endslot
            @component('backend::component.form.input')
                @slot('name') config_title @endslot
                @slot('value') {{$config_info->title ?? ''}} @endslot
            @endcomponent
        @endcomponent
        @component('backend::component.form.form-group')
            @slot('title')配置类型@endslot
            @component('backend::component.form.select',['options'=>config('app.conf_type_list')])
                @slot('name') config_type @endslot
                @slot('value') {{$config_info->type ?? '1'}} @endslot
            @endcomponent
        @endcomponent

        @component('backend::component.form.form-group')
            @slot('title')配置分组@endslot
            @component('backend::component.form.select',['options'=>config('app.conf_group_list')])
                @slot('name') config_group @endslot
                @slot('value') {{$config_info->group ?? '1'}} @endslot
            @endcomponent
        @endcomponent

        @component('backend::component.form.form-group')
            @slot('title')配置值@endslot
            @component('backend::component.form.textarea')
                @slot('name') config_value @endslot
                @slot('value') {{$config_info->value ?? ''}} @endslot
            @endcomponent
        @endcomponent

        @component('backend::component.form.form-group')
            @slot('title')配置项@endslot
            @component('backend::component.form.textarea')
                @slot('name') config_extra @endslot
                @slot('value') {{$config_info->extra ?? ''}} @endslot
            @endcomponent
        @endcomponent

        @component('backend::component.form.form-group')
            @slot('title')说明@endslot
            @component('backend::component.form.textarea')
                @slot('name') remark @endslot
                @slot('value') {{$config_info->remark ?? ''}} @endslot
            @endcomponent
        @endcomponent

        @component('backend::component.form.form-group')
            @slot('title')排序@endslot
            @component('backend::component.form.input')
                @slot('name') sort @endslot
                @slot('value') {{$config_info->sort ?? '1000'}} @endslot
            @endcomponent
        @endcomponent

        @component('backend::component.form.form-group')
            @slot('title')状态@endslot
            @foreach(['0'=>'禁用','1'=>'启用'] as $key=>$item)
                @component('backend::component.radio')
                    @slot('name') status @endslot
                    @slot('title') {{$item}} @endslot
                    @slot('value') {{$key}} @endslot
                    @slot('checked')
                        @if(isset($config_info->status)&&$config_info->status == $key) checked @endif
                    @endslot
                @endcomponent
            @endforeach
        @endcomponent
        @slot('buttons')
            @component('backend::component.form.button')
                @slot('title') 提交 @endslot
                @slot('params') {"formId":"#config-form"} @endslot
                @slot('class') btn-min-width ajax-form @endslot
            @endcomponent
            @component('backend::component.form.button')
                @slot('title') 重置 @endslot
                @slot('type') reset @endslot
                @slot('color') danger @endslot
                @slot('class') btn-min-width @endslot
            @endcomponent
        @endslot
    @endcomponent
@endsection